package com.okami.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author: TanJingyu
 * @create: 2021-03-16 10:53
 **/
@RestController
@RequestMapping("/hello")
public class HelloController {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    @GetMapping
    public String hello() {
        Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap("select * from orders");
        System.out.println(stringObjectMap);
        return "hello...";
    }
}
